﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Research.Kinect.Nui;
using System.Threading;

namespace MocKinect.Proxies
{
    public class CameraProxy : BaseProxy
    {
        public CameraProxy(Runtime mocKinectRuntime)
            : base(mocKinectRuntime)
        {
        }

        public int ElevationAngle
        {
            get
            {
                if (mocKinectRuntime.RealKinectRuntime != null)
                    return mocKinectRuntime.RealKinectRuntime.NuiCamera.ElevationAngle;
                return 0;
            }
            set
            {
                if (mocKinectRuntime.RealKinectRuntime != null)
                    mocKinectRuntime.RealKinectRuntime.NuiCamera.ElevationAngle = value;
            }
        }

        public void GetColorPixelCoordinatesFromDepthPixel(ImageResolution colorResolution, ImageViewArea viewArea, int depthX, int depthY, short depthValue, out int colorX, out int colorY)
        {
            colorX = depthX;
            colorY = depthY;
            if (mocKinectRuntime.RealKinectRuntime != null)
            {
                mocKinectRuntime.RealKinectRuntime.NuiCamera.GetColorPixelCoordinatesFromDepthPixel(colorResolution, viewArea, depthX, depthY, depthValue, out colorX, out colorY);
            }
        }

    }
}
